# Contributor: Carlo Landmeter
# Maintainer:
pkgname=scstadmin
pkgver=2.2.0
pkgrel=6
pkgdesc="SCST administration tool written in perl"
url="https://scst.sourceforge.net/"
arch="noarch"
license="GPL-2.0"
options="!check" # no testsuite
depends="perl"
makedepends="perl-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://downloads.sourceforge.net/scst/scstadmin-$pkgver.tar.bz2
	scstadmin.initd
	"

build() {
	cd scstadmin.sysfs/scst-0.9.10
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

package() {
	cd scstadmin.sysfs/scst-0.9.10
	make DESTDIR="$pkgdir" install

	cd "$builddir"
	mkdir -p "$pkgdir"/var/lib/scst/pr
	install -Dm755 scstadmin.sysfs/scstadmin "$pkgdir"/usr/sbin/scstadmin
	install -Dm755 "$srcdir"/scstadmin.initd "$pkgdir"/etc/init.d/scstadmin
}

sha512sums="
0c1ebf27203c63f3ec16a6c4ca159d4203da902ed8cc3fc6b8a415847c39a83294609c325e0c736e60a8e7cbb445ab2f3914dd9df980238363c6d8be98f0d08e  scstadmin-2.2.0.tar.bz2
ba39bb8e7bfd77cfcdac42c8f34867d1dbccd0f153307e1630ecc0d11a02fb8275aecd87ea8a05c2d1fa939457e434a5a8c26c69f6f1cf9a47ef486eb0ab43a3  scstadmin.initd
"
